import { http as axios } from './request'

//城市选择的时候调用改接口，点击后进入内容可以直接展示在列表头部
export const drivingSchoolByCity = () => {
    return axios({
        method: 'GET',
        url: '/api/system/school/city/info'
    })
}

//驾校详情
export const drivingSchoolDetailById = (id: string) => {
    return axios({
        method: 'GET',
        url: '/api/system/school/detail/info',
        params: { id }
    })
}

//教练列表
export const coachList = (current: number, schoolId: string, size = 10) => {
    return axios({
        method: 'GET',
        url: '/api/system/schoolCoach/list/info',
        params: { current, schoolId, size }
    })
}

//训练场详情
export const siteDetail = (id: string) => {
    return axios({
        method: 'GET',
        url: '/api/system/trainSite/detail/info',
        params: { id }
    })
}

export interface StorePageProps {
    regionId: string
    current: number
    lat: number
    lng: number
    schoolId: string
    size: number
}

//根据驾校查询所有门店
export const storeListByDrivingSchool = (params: StorePageProps) => {
    return axios({
        method: 'GET',
        url: '/api/system/schoolStore/page/list',
        params
    })
}
//获取门店区域列表
export const storeCityList = (schoolId: string, city: string) => {
    return axios({
        method: 'GET',
        url: '/api/system/schoolStore/region/list',
        params: { schoolId, city }
    })
}

//获取交通信息
export const trafficInfo = (from: string, to: string, policy: string) => {
    return axios({
        method: 'GET',
        url: '/api/system/lbs/directionTransit',
        params: { from, to, policy }
    })
}
//获取步行线路
export const walkInfo = (from: string, to: string) => {
    return axios({
        method: 'GET',
        url: '/api/system/lbs/directionWalking',
        params: { from, to }
    })
}

//驾校评价
export const evaluateList = (schoolId: string, current: number, size = 10) => {
    return axios({
        method: 'GET',
        url: '/api/system/schoolReview/page/list',
        params:{
            schoolId,current,size
        }
    })
}